#ifndef DBUSADAPTOR_H
#define DBUSADAPTOR_H

#include <QtDBus>

#include "formmain.h"

/*! \brief Simple DBus adaptor for RSSGuard.
It allows another instance to raise original window.
\author Petr Vanek <petr@scribus.info>
*/
class DBusAdaptor : public QDBusAbstractAdaptor
{
    Q_OBJECT
    //! \warning keep the string synced with definitions.h. Unfortunately we cannot use define here due moc's parsing...
    Q_CLASSINFO("D-Bus Interface", "org.rssguard.application")

public:
    DBusAdaptor(FormMain * manager)
        : QDBusAbstractAdaptor(manager),
          m_manager(manager)
    {
    }

public slots:

    Q_NOREPLY void raise()
    {
        m_manager->showWindow();
    }

private:
    FormMain * m_manager;
};

#endif
